package client

import (
	"context"
	"github.com/go-kratos/kratos/v2/middleware/recovery"
	transgrpc "github.com/go-kratos/kratos/v2/transport/grpc"
	pb "go-mall/api/helloworld/v1"
)

func NewHelloWorldCli(addr string) pb.HelloworldClient {
	conn, _ := transgrpc.DialInsecure(
		context.Background(),
		transgrpc.WithEndpoint(addr),
		transgrpc.WithMiddleware(
			recovery.Recovery(),
		),
	)
	//defer conn.Close()
	client := pb.NewHelloworldClient(conn)
	return client
}
